<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}{% endblock %}</title>
    <link rel="stylesheet" href="/static/bootstrap4/css/bootstrap.css">
    <link rel="stylesheet" href="/static/tabulator/css/bootstrap/tabulator_bootstrap4.min.css">
    <link rel="stylesheet" href="/static/tabulator/css/tabulator.css">
    <link rel="stylesheet" href="/static/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/static/iziModal/iziModal.min.css">
</head>
<body class="container">
<div class="row">
    <div class="col-12">
        <nav class="navbar navbar-expand-lg navbar-light bg-light">
            <a class="navbar-brand" href="#"><i class="fa fa-flag" style="color: red"></i></a>
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
                    aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>

            <div class="collapse navbar-collapse" id="navbarSupportedContent">
                <ul class="navbar-nav mr-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'dict:recall' %}">回忆默写</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'dict:index' %}">修改单词</a>
                    </li>

                    <li class="nav-item">
                        <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">统计</a>
                    </li>
                </ul>
            </div>
        </nav>
    </div>
</div>
{% block content %}
{% endblock %}
</body>
</html>
<script src="/static/jquery/jquery-3.5.1.js"></script>
<script src="/static/bootstrap4/js/bootstrap.js"></script>
<script src="/static/tabulator/js/tabulator.js"></script>
<script src="/static/iziModal/iziModal.min.js"></script>
<script>
    $(document).ready(function () {
        // csrf
        let csrftoken = jQuery("[name=csrfmiddlewaretoken]").val();

        function csrfSafeMethod(method) {
            // these HTTP methods do not require CSRF protection
            return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
        }

        $.ajaxSetup({
            beforeSend: function (xhr, settings) {
                if (!csrfSafeMethod(settings.type) && !this.crossDomain) {
                    xhr.setRequestHeader("X-CSRFToken", csrftoken);
                }
            }
        });
    });
</script>
{% block script %}
{% endblock %}
